import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/train_plan/course_statistics_entity.dart';

CourseStatisticsEntity $CourseStatisticsEntityFromJson(Map<String, dynamic> json) {
  final CourseStatisticsEntity courseStatisticsEntity = CourseStatisticsEntity();
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    courseStatisticsEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    courseStatisticsEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    courseStatisticsEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    courseStatisticsEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    courseStatisticsEntity.id = id;
  }
  final String? planId = jsonConvert.convert<String>(json['planId']);
  if (planId != null) {
    courseStatisticsEntity.planId = planId;
  }
  final int? qualified = jsonConvert.convert<int>(json['qualified']);
  if (qualified != null) {
    courseStatisticsEntity.qualified = qualified;
  }
  final int? textbookApproAch = jsonConvert.convert<int>(json['textbookApproAch']);
  if (textbookApproAch != null) {
    courseStatisticsEntity.textbookApproAch = textbookApproAch;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    courseStatisticsEntity.textbookId = textbookId;
  }
  final String? textbookLecturerId = jsonConvert.convert<String>(json['textbookLecturerId']);
  if (textbookLecturerId != null) {
    courseStatisticsEntity.textbookLecturerId = textbookLecturerId;
  }
  final String? textbookLecturerName = jsonConvert.convert<String>(json['textbookLecturerName']);
  if (textbookLecturerName != null) {
    courseStatisticsEntity.textbookLecturerName = textbookLecturerName;
  }
  final String? textbookName = jsonConvert.convert<String>(json['textbookName']);
  if (textbookName != null) {
    courseStatisticsEntity.textbookName = textbookName;
  }
  final int? unqualified = jsonConvert.convert<int>(json['unqualified']);
  if (unqualified != null) {
    courseStatisticsEntity.unqualified = unqualified;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    courseStatisticsEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    courseStatisticsEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    courseStatisticsEntity.updateDate = updateDate;
  }
  final int? viewNumber = jsonConvert.convert<int>(json['viewNumber']);
  if (viewNumber != null) {
    courseStatisticsEntity.viewNumber = viewNumber;
  }
  return courseStatisticsEntity;
}

Map<String, dynamic> $CourseStatisticsEntityToJson(CourseStatisticsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['planId'] = entity.planId;
  data['qualified'] = entity.qualified;
  data['textbookApproAch'] = entity.textbookApproAch;
  data['textbookId'] = entity.textbookId;
  data['textbookLecturerId'] = entity.textbookLecturerId;
  data['textbookLecturerName'] = entity.textbookLecturerName;
  data['textbookName'] = entity.textbookName;
  data['unqualified'] = entity.unqualified;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['viewNumber'] = entity.viewNumber;
  return data;
}

extension CourseStatisticsEntityExtension on CourseStatisticsEntity {
  CourseStatisticsEntity copyWith({
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? planId,
    int? qualified,
    int? textbookApproAch,
    String? textbookId,
    String? textbookLecturerId,
    String? textbookLecturerName,
    String? textbookName,
    int? unqualified,
    String? updateBy,
    String? updateById,
    String? updateDate,
    int? viewNumber,
  }) {
    return CourseStatisticsEntity()
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..planId = planId ?? this.planId
      ..qualified = qualified ?? this.qualified
      ..textbookApproAch = textbookApproAch ?? this.textbookApproAch
      ..textbookId = textbookId ?? this.textbookId
      ..textbookLecturerId = textbookLecturerId ?? this.textbookLecturerId
      ..textbookLecturerName = textbookLecturerName ?? this.textbookLecturerName
      ..textbookName = textbookName ?? this.textbookName
      ..unqualified = unqualified ?? this.unqualified
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..viewNumber = viewNumber ?? this.viewNumber;
  }
}
